<?php
/*
 * Created Febuary 12,2011
 * @Author Matt Edmonds
 */
include_once(dirname(__FILE__).'/../database/dbDonation.php');
class testdbDonation extends UnitTestCase {
      function testdbDonationModule() {
//add a Donation
$m = new Donation("1", "3-21-96", "1", "1");
$this->assertTrue(add_donation($m));

//add a Donation
$m = new Donation("2", "7-15-99", "2", "2");
$this->assertTrue(add_donation($m));

//add a Donation
$m = new Donation("3", "2-13-78", "3", "3");
$this->assertTrue(add_donation($m));


//get a Donation
$p = get_donation("1");
$this->assertTrue($p!==null);

//get a Donation
$p = get_donation("3");
$this->assertTrue($p!==null);



//try to add a duplicate - should return false
$v = new Donation("1", "3-21-96", "1", "1");
$this->assertFalse(add_donation($v));


//try to get a donation that is not in the db
$this->assertFalse(get_donation("4"));

//get a donation
$p = get_donation("1");
$this->assertTrue($p!==null);



//remove all persons
$this->assertTrue(remove_donation("1"));
$this->assertTrue(remove_donation("2"));
$this->assertTrue(remove_donation("3"));


//try to remove a donation not in the db - should not work
$this->assertFalse(remove_donation("1"));

echo("testdbDonation complete");
      }
}


?>
